import {reactive} from "vue";
import Flower, {Daffodil, Hyacinth, Hydrangea, Iris, Saffron, Tulip} from "@/modal/Flower";
import Fruit, {Apple, Blackberry, Peach, Raspberry} from "@/modal/Fruit";
import Tool, {
  Barrels,
  Barrow,
  Fork,
  Glass,
  Gorgeous, Graver,
  Mower,
  Pie,
  Salad,
  Saucepan, Seeder,
  Shovel,
  Soil,
  Suit,
  Tractor
} from "@/modal/Tool";
// 实例化花卉
const store_flower: any = reactive([Tulip, Hydrangea, Iris, Hyacinth, Saffron, Daffodil]);
store_flower.forEach((value: any, index: number, array: any) => {
  array.splice(index, 1, new value());
})
// 实例化果园
const store_fruit: any = reactive([Apple, Peach, Blackberry, Raspberry]);
store_fruit.forEach((value: any, index: number, array: any) => {
  array.splice(index, 1, new value());
})
// 实例化工具棚
const store_tool: any = reactive([Glass, Pie, Shovel, Salad, Barrels, Saucepan, Gorgeous, Suit, Fork, Mower, Barrow, Soil, Tractor, Graver, Seeder]);
store_tool.forEach((value: any, index: number, array: any) => {
  array.splice(index, 1, new value());
})
export const store = reactive({
  flowers: <Flower[]>store_flower,
  fruits: <Fruit[]>store_fruit,
  tools: <Tool[]>store_tool
})